package org.lds.simple.disruptor.strategy;

import lombok.extern.slf4j.Slf4j;
import org.lds.simple.disruptor.sequence.Sequence;

@Slf4j
public class YieldWaitStrategy implements WaitStrategy {
    @Override
    public long consumerWait(Sequence producerSequence, Sequence consumerSequence) {
        while (!allowConsume(producerSequence, consumerSequence)) {
            Thread.yield();
        }
        return producerSequence.get();
    }

    @Override
    public void notifyConsumer() {

    }
}
